<%@ include file = "connection.jsp" %>
<%
String userid=request.getParameter("userid");
String katalaluan=request.getParameter("katalaluan");

//out.println(userid);
//out.println(katalaluan);

Connection conn=null;
PreparedStatement pstmt=null;
ResultSet rs = null;

String user_id = "";
String user_katalaluan = "";	
boolean ada = false;

conn=getConnected();

String sql = "select user_id, user_password from admin where user_id=? and user_password =?";
pstmt=conn.prepareStatement(sql);
pstmt.clearParameters();
pstmt.setString(1,userid);
pstmt.setString(2,katalaluan);
rs = pstmt.executeQuery();

while( rs.next() )
{
	user_id = rs.getString("user_id");
	user_katalaluan = rs.getString("user_password");
	ada = true;
}

if( ada == true )
{	
	out.println ("Anda pengguna yang sah");		
}
else
{
	out.println ("Anda pengguna tidak sah cb");	
}


rs.close();
pstmt.close();
conn.close();

%>

